package com.bdqn.zhang.util;

import com.bdqn.zhang.pojo.MyTask;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * <Description> <br>
 *
 * @author tao<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2019/09/26 15:21 <br>
 * @see com.bdqn.zhang.util <br>
 */
@Component
@EnableScheduling //启动定时任务
public class SimpleTask {

    @Resource
    private MyTask myTask;

    @Scheduled(cron = "*/5 * * * * ? ")
    /*更多表达式 配置 参考 https://www.cnblogs.com/lazyInsects/p/8075487.html*/
    public void showConsole(){
        myTask.say();
    }
}
